home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / mathtime / mathtime.tex < prev    next >
Encoding:
Text File  |  1994-04-19  |  33.3 KB  |  979 lines

  1. %%% Start-of-TeX-file mathtime.tex
  2. %%% ====================================================================
  3. %%%  @TeX-file{
  4. %%%     author          = "Adam H. Lewenberg",
  5. %%%     version         = "1.30",
  6. %%%     date            = "08 April 1994",
  7. %%%     filename        = "mathtime.tex",
  8. %%%     address         = "Department of Mathematics
  9. %%%                        University of Illinois at Urbana-Champaign
  10. %%%                        Urbana, Illinois 61801
  11. %%%                        USA
  12. %%%                        Tel: (217) 333-3350",
  13. %%%     checksum        = "36707 978 4110 34084",
  14. %%%     email           = "adam@math.uiuc.edu",
  15. %%%     codetable       = "ISO/ASCII",
  16. %%%     keywords        = "MathTime PostScript TeXplorator's",
  17. %%%     supported       = "yes",
  18. %%%     abstract        = "These macros replace the Computer Modern
  19. %%%                        math fonts by the MathTime math fonts (from
  20. %%%                        the TeXplorators Corp.)",
  21. %%%     docstring       = "This file contains macros to define
  22. %%%                        text fonts and math fonts using PostScript
  23. %%%                        fonts for text and the MathTime fonts for
  24. %%%                        math.  An example of how this is
  25. %%%                        done is given at the bottom of this file.
  26. %%%                        This file uses the mtmacs.tex set of macros
  27. %%%                        that come with the MathTime fonts. These
  28. %%%                        macros are compatible with:
  29. %%%                             PLAIN
  30. %%%                             AmSTeX (version 2.1 or later)
  31. %%%                             AmSTeX+AMSPPT.STY
  32. %%%                             LAmSTeX (version 2.0 or later)
  33. %%%
  34. %%%                        These macros are decidedly NOT compatible
  35. %%%                        with LaTeX or the NFSS (New Font
  36. %%%                        Selection Scheme).
  37. %%%
  38. %%%                        A sample style using these macros is given
  39. %%%                        in the file mttim10.tex (available
  40. %%%                        separately).
  41. %%%
  42. %%%                        Note that these macros are USELESS without
  43. %%%                        the MathTime fonts. These fonts are
  44. %%%                        available from the TeXplorators Corp
  45. %%%                        and are NOT freely-copyable (although
  46. %%%                        inexpensive). 
  47. %%%
  48. %%%                        The checksum field above contains a CRC-16
  49. %%%                        checksum as the first value, followed by the
  50. %%%                        equivalent of the standard UNIX wc (word
  51. %%%                        count) utility output of lines, words, and
  52. %%%                        characters.  This is produced by Robert
  53. %%%                        Solovay's checksum utility.",
  54. %%%     dependencies    = "mtmacs.tex MathTime-fonts"
  55. %%%  }
  56. %%% ====================================================================
  57. %%% mathtime.tex version 1.30
  58. %%% Adam H. Lewenberg    adam@math.uiuc.edu
  59. %%% Department of Mathematics, University of Illinois at Urbana-Champaign
  60. %%%  -- Please report any bugs to the above address. --
  61. %%%
  62. %%% COPYRIGHT: This file copyright 1993, 1994 by Adam H. Lewenberg. For
  63. %%% restrictions on use see below.
  64. %%%
  65. %%% RESTRICTIONS: This file is freely copyable. If you want to change
  66. %%% something, change the filename from mathtime.tex to something else and
  67. %%% indicate any changes in the file itself, or else remove my name
  68. %%% from the file completely. However, you are allowed to remove all
  69. %%% lines beginning with "%% " (two percent characters followed by a
  70. %%% space). 
  71. %%%
  72. %%% SUMMARY:  A generic PostScript-text-fonts/MathTime-math-fonts
  73. %%% style. Note well that if a non-PostScript font is used for the text
  74. %%% faces, bad things will happen. For use, see the instructions
  75. %%% following the \endinput below. For information on mtmacs.tex, see the 
  76. %%% mtmacs.tex documentation that comes with the MathTime fonts.
  77. %%%
  78. %%% The mathtime.tex macros can be used within a group safely. 
  79. %%%
  80. %%% The MathTime fonts are available from the TeXplorator's Corporation
  81. %%% (address given below).  Although the file mathtime.tex is freely
  82. %%% copyable, the MathTime fonts are not.
  83. %%%
  84. %%%            The TeXplorators Corporation
  85. %%%            1572 West Gray, #377
  86. %%%            Houston, TX  77019-4948  USA
  87. %%%
  88. %%% GLOBAL CONSTRUCTS:
  89. %%%
  90. %%%             (none)
  91. %%%
  92. %%% COMPATIBLE WITH:
  93. %%%             Plain
  94. %%%             AmSTeX
  95. %%%             AmSTeX + AMSPPT.STY
  96. %%%             LAmSTeX
  97. %%%
  98. %%% (See COMPATIBILITY NOTES below!!)
  99. %%%
  100. %%% THINGS TO DO:
  101. %%%
  102. %%%       1. Change \MathRoman and other mtmacs.tex commands to work in
  103. %%%          eight point.
  104. %%%
  105. %%% USE: The file mathtime.tex by itself does not change fonts, rather,
  106. %%% it sets up macros to change fonts. For an example and instructions
  107. %%% on the font-changing macros, see the bottom of this file (search
  108. %%% for the string 'Sample Implementation'), or see the file mttim10.tex.
  109. %%%
  110. %%% COMPATIBILITY NOTES: mtmacs.tex changes the catcode of _ (the
  111. %%% underscore character) from 8 (subscript) to 13 (active). This can
  112. %%% cause problems if some other macro package tries to play with the _
  113. %%% character (for example, old versions of the eplain.tex package). A
  114. %%% fix is given below in section 2.
  115. %%%
  116. %%% When using with AmSTeX+AMSPPT.STY load mathtime.tex AFTER the
  117. %%% \documentstyle{amsppt} command and BEFORE \topmatter.
  118. %%%
  119. %%% Neither plain.tex or amstex.tex defines a smallcaps control
  120. %%% sequence (although AMSPPT.STY defines \smc). So I have made the
  121. %%% control sequence \CapsAndSmallCaps{...} define \sc to be the font
  122. %%% \tensmc if is called outside of AMSPPT.STY.
  123. %%%
  124. %%% FONT FAMILIES: A comment about font families: There are only
  125. %%% sixteen font families available to TeX. Here is a summary of the
  126. %%% families PLAIN uses: 
  127. %%%     0    text roman
  128. %%%     1    math italic
  129. %%%     2    math symbols
  130. %%%     3    math extensions
  131. %%%     4    text italic
  132. %%%     5    text bold
  133. %%%     6    text slant (oblique)
  134. %%%     7    typewriter (monospaced)
  135. %%
  136. %%% AMSTEX has the potential to use 6 more: 
  137. %%%   MSAM*    math symbols A
  138. %%%   MSBM*    math symbols B
  139. %%%   EUFM     Euler Fraktur medium
  140. %%%   EUFB     Euler Fraktur bold
  141. %%%   EUSM     Euler Script medium
  142. %%%   BOLD     Bold versions of cmsy/cmmi   NB: Uses TWO (2) families!!!!
  143. %%
  144. %%% Those marked with a * are used by AMSPPT.STY. So, if AMSPPT.STY is
  145. %%% called, there are only 6 left. So, at best you have 8 remaining
  146. %%% and at worst you have 2 remaining. The only families used up by
  147. %%% mathtime.tex are in the optional macros \NewCalligraphic and the
  148. %%% \OldNumeralsNewFamily macros. In short, \NewCalligraphic and
  149. %%% \OldNumeralsNewFamily should be used with care. (But read section
  150. %%% 3E carefully on ways of using OldNumerals wihtout using up a font
  151. %%% family.) 
  152. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  153. %% 1. Preliminary business
  154. %%
  155. %%   1A. Ensure that this file is loaded only once.
  156. %%
  157. % Load mathtime.tex only once.
  158. \ifx\mathtimeloaded\undefined
  159.   \let\next\relax
  160.   \let\mathtimeloaded\relax
  161. \else
  162.   \message{[mathtime.tex already loaded]}%
  163.   \let\next\endinput
  164. \fi
  165. \next
  166. %
  167. %%
  168. %%   1B. Save various catcodes. 
  169. %%
  170. % Save the catcodes of @ and ". (From Michal Jaegermann)
  171. \edef\recoveratcodezqrz{\catcode`\noexpand\@=\the\catcode`\@}
  172. \catcode`\@=11
  173. \edef\recoverquotecodezqrz{\catcode`\noexpand\"=\the\catcode`\"}
  174. \catcode`\"=12
  175. %
  176. %%
  177. %%   1C. Define a generic load-only-once macro. 
  178. %%
  179. \def\loadonlyonce#1{%
  180.   \expandafter\ifx\csname #1\endcsname\relax
  181.   \else \message{[#1 already loaded]}\endinput\fi
  182.   \expandafter\let\csname #1\endcsname\empty
  183. }
  184. %
  185. %%
  186. %%   1D. Make a banner macro. 
  187. %%
  188. \def\FONTStyle#1{
  189. \message{This is the #1 style.}
  190. \message{For use with (PlainTeX/AmsTeX/AmsTeX+amsppt.sty/LamsTeX).}
  191. \message{--Please report any problems to adam@math.uiuc.edu--}
  192. }
  193. %
  194. %%
  195. %%   1E. Define some \newif's.
  196. %%
  197. \newif\ifAMSTEXloaded
  198. \newif\ifAMSPPTloaded
  199. %
  200. \expandafter\ifx\csname amsppt.sty\endcsname\relax
  201.      \AMSPPTloadedfalse\else\AMSPPTloadedtrue\fi
  202. %
  203. \ifx\amstexloaded@\relax\AMSTEXloadedtrue\else\AMSTEXloadedfalse\fi
  204. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  205. %% 2. Load mtmacs.tex and reinstate the catcode of @.
  206. %%
  207. \input mtmacs
  208. % Make the catcode of @ a letter again. (The old version of mtmacs.tex
  209. % would fiddle with the catcode of @.)
  210. \catcode`\@=11
  211. %%
  212. %% NOTE WELL: The catcode of _ (the underscore) is changed from 8
  213. %% (as it is in PLAIN, LATEX, AMSTEX, etc) to "active" by mtmacs.tex.
  214. %% This can have dire consequences if some other package needs to use
  215. %% the _ in its \catcode=8 role. If this is the case, put the lines
  216. %%
  217. %%     \xdef\recoverunderscore{\catcode`\noexpand\_=\the\catcode`\_}
  218. %%     \catcode`\_=8
  219. %%
  220. %% right BEFORE the underscore is used, and then put 
  221. %%
  222. %%     \recoverunderscore
  223. %%
  224. %% right after you are done using the underscore.
  225. %% Fortunately, this circumstance is relatively rare.
  226. %%
  227. %%
  228. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  229. %% 3. Define the various fonts: 
  230. %%     3A. Math fonts
  231. %%    3B. Text fonts
  232. %%    3C. AMSfonts
  233. %%    3D. Other fonts (Calligraphic)
  234. %%    3E. Other fonts (Old Style Digits)
  235. %%
  236. %% The format is slightly different in each case, but the font sizes
  237. %% are given by the following:
  238. %%
  239. %% {10pt sz}{9pt sz}{8pt sz}{7pt sz}{6pt sz}{5pt sz}
  240. %%    #1       #2      #3      #4      #5      #6   
  241. %%   text                    script         scriptscript
  242. %%
  243. %% In every instance it is important to put something for each font
  244. %% size even if you do not plan to use that size. For example, in none of
  245. %% the packages is the nine point used, but put something in anyway. 
  246. %%
  247. %%%%%%%%%%%%%%%%%%%%%%
  248. %%   3A. Math fonts
  249. %%       Example of use:
  250. %%
  251. %%          \mathitalic{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  252. %%          \mathsymbols{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  253. %%          \mathextension{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  254. %%
  255. %
  256. % family 1  (uses MTMI)
  257. \def\mathitalic#1#2#3#4#5#6{
  258.   \MTMI{#1}{#4}{#6}
  259.   \font\teni=\fontname\textfont\@ne
  260.   \font\seveni=\fontname\scriptfont\@ne
  261.   \font\fivei=\fontname\scriptscriptfont\@ne
  262.   \ifAMSPPTloaded
  263. %   \font\ninei=MTMI at #2  \skewchar\ninei=45
  264.     \font\eighti=MTMI at #3  \skewchar\eighti=45
  265.     \font\sixi=MTMI at #5   \skewchar\sixi=45
  266.   \fi
  267. }
  268. %
  269. % family 2  (uses MTSY)
  270. \def\mathsymbols#1#2#3#4#5#6{
  271.   \MTSY{#1}{#4}{#6}
  272.   \font\tensy=\fontname\textfont\tw@
  273.   \font\sevensy=\fontname\scriptfont\tw@ 
  274.   \font\fivesy=\fontname\scriptscriptfont\tw@
  275.   \ifAMSPPTloaded
  276. %   \font\ninesy=MTMI at #2  \skewchar\ninei=48
  277.     \font\eightsy=MTSY at #3  \skewchar\eightsy=48
  278.     \font\sixsy=MTSY at #5   \skewchar\sixsy=48
  279.   \fi
  280. }
  281. %
  282. % family 3  (uses MTEX)
  283. \def\mathextension#1#2#3#4#5#6{
  284.   \MTEX{#1}
  285.   \font\tenex=\fontname\textfont\thr@@
  286.   \ifAMSPPTloaded
  287. %   \font\nineex=MTEX at #2
  288.     \font\sevenex=MTEX at #4
  289.     \font\eightex=MTEX at #3
  290.   \fi
  291. }
  292. %
  293. %%
  294. %%%%%%%%%%%%%%%%%%%%%%
  295. %%   3B. Text fonts
  296. %%       Example of use:
  297. %%
  298. %%       (The format is similar to the math fonts, except the first
  299. %%       argument must be the base name of the font.)
  300. %%           \Roman{ptmr}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  301. %%           \Boldface{ptmrb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  302. %%           \Italic{ptmri}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  303. %%           \Slant{ptmro}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  304. %%           \Typewriter{pcrb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  305. %%           \CapsAndSmallCaps{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  306. %% 
  307. %% Each of these control sequences also defines a macro which defines
  308. %% the font they call. For example, \Roman{ptmr}..{} defines the macro
  309. %% \RomanFont to be ptmr. Thus, you can say things like
  310. %%
  311. %%            \font\bigtext=\RomanFont at 20pt 
  312. %%
  313. %% So, you can more easily change from one font style to another
  314. %% since \bigtext will not be a specific font but rather a large
  315. %% version of whatever the Roman font is. The macros so defined are: 
  316. %%
  317. %%            \RomanFont
  318. %%            \ItalicFont
  319. %%            \SlantFont
  320. %%            \BoldfaceFont
  321. %%            \TypewriterFont
  322. %%            \CapsAndSmallCapsFont
  323. %%
  324. %% The font defining  macros are all implemented ad-hoc because of the
  325. %% ad-hoc nature in which font families use fonts in the various macro
  326. %% packages. The following table spells this out.
  327. %%
  328. %% PLAIN
  329. %% fam  text    script  scriptscript
  330. %% 3    10      10      10
  331. %% 4    10      undef   undef
  332. %% 5    10      undef   undef
  333. %% 6    10      7       5
  334. %% 7    10      undef   undef
  335. %%
  336. %% AMSTEX
  337. %% fam  text    script  scriptscript
  338. %% 3    10      10      10
  339. %% 4    10      10      10
  340. %% 5    10      10      10
  341. %% 6    10      7       5
  342. %% 7    10      undef   undef
  343. %%
  344. %% AMSTEX+AMSPPT.STY
  345. %% fam  text    script  scriptscript
  346. %% 3    10      7       7
  347. %% 4    10      7       7
  348. %% 5    10      10      10
  349. %% 6    10      7       5
  350. %% 7    10      undef   undef
  351. %%
  352. %% LAMSTEX (same as AMSTEX)
  353. %% fam  text    script  scriptscript
  354. %% 4    10      10      10
  355. %% 5    10      10      10
  356. %% 6    10      7       5
  357. %% 7    10      undef   undef
  358. %%
  359. %
  360. % family 0
  361. \def\Roman#1#2#3#4#5#6#7{
  362.  \font\tenrm=#1 at #2
  363.  \font\sevenrm=#1 at #5
  364.  \font\fiverm=#1 at #7
  365.  \textfont0=\tenrm \scriptfont0=\sevenrm 
  366.  \scriptscriptfont0=\fiverm
  367.  \ifAMSPPTloaded 
  368. %  \font\ninerm=#1 at #3
  369.    \font\eightrm=#1 at #4
  370.    \font\sixrm=#1 at #6
  371.  \fi
  372.  \edef\RomanFont{#1 }%
  373. }
  374. %
  375. % family 4
  376. \def\Italic#1#2#3#4#5#6#7{
  377.  \font\tenit=#1 at #2
  378.  \textfont4=\tenit
  379.  \ifAMSPPTloaded
  380.    \font\sevenit=#1 at #5
  381.    \scriptfont4=\sevenit
  382.    \scriptscriptfont4=\sevenit
  383. %  \font\nineit=#1 at #3
  384.    \font\eightit=#1 at #4
  385.  \else
  386.    \ifAMSTEXloaded
  387.      \scriptfont4=\tenit
  388.      \scriptscriptfont4=\tenit
  389.    \fi
  390.  \fi
  391.  \edef\ItalicFont{#1 }%
  392. }
  393. %
  394. % family 5
  395. \def\Slant#1#2#3#4#5#6#7{
  396.  \font\tensl=#1 at #2
  397.  \textfont5=\tensl
  398.  \ifAMSTEXloaded
  399.    \scriptfont5=\tensl
  400.    \scriptscriptfont5=\tensl
  401.  \fi
  402.  \ifAMSPPTloaded
  403. %  \font\ninesl=#1 at #3
  404.    \font\eightsl=#1 at #4
  405.  \fi
  406.  \edef\SlantFont{#1 }%
  407. }
  408. %
  409. % family 6
  410. \def\Boldface#1#2#3#4#5#6#7{
  411.  \font\tenbf=#1 at #2
  412.  \font\sevenbf=#1 at #5
  413.  \font\fivebf=#1 at #7
  414.  \textfont6=\tenbf \scriptfont\bffam=\sevenbf
  415.  \scriptscriptfont\bffam=\fivebf
  416.  \ifAMSPPTloaded
  417. %  \font\ninebf=#1 at #3
  418.    \font\eightbf=#1 at #4
  419.    \font\sixbf=#1 at #6
  420.  \fi
  421.  \edef\BoldfaceFont{#1 }%
  422. }
  423. %
  424. % family 7
  425. \def\Typewriter#1#2#3#4#5#6#7{
  426.  \font\tentt=#1 at #2
  427.  \textfont7=\tentt
  428.  \ifAMSPPTloaded
  429. %  \font\ninett=#1 at #3
  430.    \font\eighttt=#1 at #4
  431.  \fi
  432.  \edef\TypewriterFont{#1 }%
  433. }
  434. %
  435. % (no family)
  436. \def\CapsAndSmallCaps#1#2#3#4#5#6#7{
  437.  \font\tensmc=#1 at #2
  438. %\font\ninesmc=#1 at #3
  439.  \font\eightsmc=#1 at #4
  440. % If NOT in amsppt.sty define \sc
  441.  \ifAMSPPTloaded\else \def\sc{\tensmc}\fi
  442.  \edef\CapsAndSmallCapsFont{#1 }%
  443. }
  444. %
  445. %%%%%%%%%%%%%%%%%%%%%%
  446. %%   3C. AMSfonts
  447. %%       Example of use:
  448. %%           \AMSFonts{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  449. %%
  450. %%       NOTE: Works with AmsTeX version 2.1 or later.
  451. %%
  452. %% I first define a generic AMSfont loading mechanism. 
  453. %% \AMSFontFamily{msa}{msam}{\msafam}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  454. %%      #1          msa = \font name prefix
  455. %%      #2         msam = file name prefix
  456. %%      #3      \msafam = family number
  457. %%      #4         10pt = textfont
  458. %%      #5          9pt = (for later use)
  459. %%      #6          8pt = \eightpoint textfont
  460. %%      #7          7pt = scriptfont
  461. %%      #8          6pt = \eightpoint textfont
  462. %%      #9          5pt = scriptscriptfont
  463. %%
  464. %
  465. %% Those who use the Blue Sky PostScript AMS fonts take note.
  466. %% The msam and msbm fonts in the PS versions come in 10, 7 and 5
  467. %% point sizes. If AMSPPT.STY is used we also need 8 and 6 point
  468. %% sizes. If you have use the PS versions of the AMS fonts you should
  469. %% have the lines:
  470. %%      \def\PSAMSFonts{TT}%  Blue Sky PS AMS fonts: True
  471. %%      %%\def\PSAMSFonts{TF}% Blue Sky PS AMS fonts: False
  472. %% in your AMSPPT.STY file. If you don't, do so NOW! Otherwise, the
  473. %% mathtime.tex macros will not work correctly. 
  474. %
  475. \def\ef@#1{\expandafter\font\csname #1\endcsname}
  476. \def\DefineAMSFontFamily#1#2#3#4#5#6#7#8#9{%
  477.   \ef@{ten#1}=#210 at #4
  478.   \ef@{seven#1}=#27 at #7
  479.   \ef@{five#1}=#25 at #9
  480.   \textfont#3=\csname ten#1\endcsname
  481.   \scriptfont#3=\csname seven#1\endcsname
  482.   \scriptscriptfont#3=\csname five#1\endcsname
  483.   \ifAMSPPTloaded
  484.     \if\PSAMSFonts
  485. %     \ef@{nine#1}=#210 at #5
  486.       \ef@{eight#1}=#27 at #6
  487.       \ef@{six#1}=#25 at #8
  488.     \else
  489. %     \ef@{nine#1}=#29 at #5
  490.       \ef@{eight#1}=#28 at #6
  491.       \ef@{six#1}=#26 at #8
  492.     \fi
  493.   \fi
  494. }
  495. %
  496. \def\AMSFonts#1#2#3#4#5#6{
  497.   \ifAMSTEXloaded
  498.     \ifx\loadmsam\empty
  499.       \DefineAMSFontFamily{msa}{msam}{\msafam}{#1}{#2}{#3}{#4}{#5}{#6}
  500.     \fi
  501.     \ifx\loadmsbm\empty
  502.       \DefineAMSFontFamily{msb}{msbm}{\msbfam}{#1}{#2}{#3}{#4}{#5}{#6}
  503.     \fi
  504.     \ifx\loadeufm\empty
  505.       \DefineAMSFontFamily{eufm}{eufm}{\eufmfam}{#1}{#2}{#3}{#4}{#5}{#6}
  506.     \fi
  507.     \ifx\loadeufb\empty
  508.       \DefineAMSFontFamily{eufb}{eufb}{\eufbfam}{#1}{#2}{#3}{#4}{#5}{#6}
  509.     \fi
  510.     \ifx\loadeusm\empty
  511.       \DefineAMSFontFamily{eusm}{eusm}{\eusmfam}{#1}{#2}{#3}{#4}{#5}{#6}
  512.     \fi
  513.     \ifx\loadbold\empty
  514.       \DefineAMSFontFamily{cmmib}{cmmib}{\cmmibfam}{#1}{#2}{#3}{#4}{#5}{#6}
  515.     \fi
  516.   \else\relax
  517.   \fi
  518.   \ifAMSPPTloaded
  519.   \else
  520.   \def\loadextrasizes@##1##2##3##4##5##6##7{%
  521.     \ifx\undefined##1%
  522.     \else
  523.       \addto\tenpoint{\textfont##1##3\scriptfont##1##5%
  524.          \scriptscriptfont##1##7}%
  525.       \addto\eightpoint{\textfont##1##4\scriptfont##1##6%
  526.          \scriptscriptfont##1##7}%
  527.     \fi
  528.   }%
  529.   \fi
  530. }
  531. %%%%%%%%%%%%%%%%%%%%%%
  532. %%   3D. Other fonts (Calligraphic) [Uses a \newfam!]
  533. %%       Example of use:
  534. %%          \NewCalligraphic{cmsy10}{cmsy9}{cmsy8}{cmsy7}{cmsy6}{cmsy5}
  535. %%
  536. %%       IMPORTANT: If you do NOT use \NewCalligraphic, then \cal (or
  537. %%       \Cal in AMSTEX) will NOT work!
  538. %%
  539. %%       NOTE: Different format than before. The skewchar of '60 is
  540. %%       from cmsy. Change this if necessary.  Note also that
  541. %%       mtmacs.tex fixes \cal and \Cal, so we don't have to.
  542. %%
  543. %%       Usually, the calligraphic characters come from font family 2
  544. %%       (which are the math symbols). However, the MathTime fonts do
  545. %%       not work this way. Instead, they assume you are using a
  546. %%       different font which contains the script fonts.
  547. %%       Since family 2 is already used up, the mtmacs.tex macros
  548. %%       allocate a new family called \Calfam.  Since there are only
  549. %%       16 font families available, use this with care.
  550. %%
  551. %
  552. \def\NewCalligraphic#1#2#3#4#5#6{
  553.   \Calligraphic{#1}{#4}{#6}% Allocates a new font family!!
  554.   \font\tencal=\fontname\textfont\Calfam
  555.   \font\sevencal=\fontname\scriptfont\Calfam
  556.   \font\fivecal=\fontname\scriptscriptfont\Calfam
  557.   \ifAMSPPTloaded
  558. %   \font\ninecal=#2  \skewchar\ninecal='60
  559.     \font\eightcal=#3  \skewchar\eightcal='60
  560.     \font\sixcal=#5   \skewchar\sixcal='60
  561.     \addto\eightpoint{\textfont\Calfam=\eightcal
  562.     \scriptfont\Calfam=\sixcal\scriptscriptfont\Calfam=\fivecal}
  563.   \fi
  564. }
  565. %%%%%%%%%%%%%%%%%%%%%%
  566. %%   3E. Other fonts (Old Style Digits)
  567. %%       Example of use:
  568. %%           \OldNumeralsOldFamily{1}
  569. %%                     or
  570. %%           \OldNumeralsNewFamily{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt} 
  571. %%                                        % This one uses a \newfam
  572. %%
  573. %% If you are using AMSTEX (or an extension of AMSTEX) you can use the
  574. %% following: 
  575. %%
  576. %%           \OldNumeralsTempFamily{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  577. %%
  578. %% The \OldNumerals macro assumes that the digits are in the normal
  579. %% place where numbers are found in a standard TeX font. If this is
  580. %% not the case, some VF hacking will be necessary. 
  581. %%
  582. %% Note that not every set of fonts will have oldstyle digits. If one
  583. %% of the above three macros is not called, then mathtime.tex cannot
  584. %% be responsible for what happens when \oldstyle is called. 
  585. %%
  586. %% In PLAIN and AMSTEX the old style digits are accessed by calling
  587. %% the math-italic family. Of course, the math-italic family is no
  588. %% longer appropriate, so we must do something else. It seems silly to
  589. %% use up a whole font family for only 10 characters, so a way around
  590. %% it is called for. There are 3 options (in decreasing order of
  591. %% desirability): 
  592. %%
  593. %%      1. [FIRST CHOICE] If the oldstyle numerals are contained in a
  594. %%         font with a font family already assigned (for example, in
  595. %%         Computer Modern the oldstyle numerals are in family 1), then
  596. %%         use the command \OldNumeralsOldFamily{n} where "n" is the
  597. %%         family number. For example, in the context of Computer
  598. %%         Modern you should use the command \OldNumeralsFamily{1}. 
  599. %%
  600. %%         Example of use:
  601. %%
  602. %%         \OldNumeralsOldFamily{1}. 
  603. %%
  604. %%      2. [SECOND CHOICE; can only be used with
  605. %%          AMSTEX/AMSTEX+AMSPPT.STY/LAMSTEX!]   
  606. %%         We "fake" a family, that is we temporarily use family 15
  607. %%         for the oldnos. This is slow, but it avoids the use
  608. %%         of a \newfam.
  609. %%
  610. %%         Example of use:
  611. %%
  612. %%         \OldNumeralsTempFamily{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  613. %%
  614. %%      3. [THIRD CHOICE] You can use up a whole font family (the
  615. %%         easiest and perhaps most efficient method). To do this, use
  616. %%         the command \OldNumeralsNewFamily. This is the least
  617. %%         desirable command as it uses up one of the precious 16 font
  618. %%         families, but if you have plenty to spare you might as well
  619. %%         use it.
  620. %%
  621. %%         Example of use:
  622. %%
  623. %%         \OldNumeralsNewFamily{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  624. %%
  625. %%                    (or synonomously)
  626. %%
  627. %%         \OldNumerals{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  628. %%
  629. %% Note also that mtmacs.tex undefines \oldnos (although for some
  630. %% strange reason \oldstyle is not touched).
  631. %%
  632. %%         PLAIN:  ${\oldstyle 1234}$   (only in math mode)
  633. %%        AMSTEX:  \oldnos{1234}        (text AND math mode)
  634. %%
  635. %
  636. %%%% FIRST CHOICE
  637. \def\DEFoldnos{%
  638.   \def\oldnos##1{\RIfM@{\mathcode`\,="013B \fam\oldnumfam##1}\else
  639.   \leavevmode\hbox{$\m@th\mathcode`\,="013B \fam\oldnumfam##1$}\fi}
  640. }% a hack to get around \if.. \fi silliness. 
  641. %
  642. \def\OldNumeralsOldFamily#1{% Use an existing family.
  643.   \edef\oldnumfam{#1}
  644.   \ifAMSTEXloaded
  645.     \DEFoldnos\let\DEFoldnos\undefined
  646.   \else
  647.     \def\oldstyle{\fam\oldnumfam \tenoldnum}
  648.   \fi
  649. }
  650. %%%% SECOND CHOICE
  651. \def\DEFtempoldnos{%
  652.   \def\oldnos##1{\RIfM@{\mathcode`\,="013B \MToldnos@{##1}}\else
  653.   \leavevmode\hbox{$\m@th\mathcode`\,="013B \MToldnos@{##1}$}\fi}
  654. }
  655. %
  656. \def\tempoldnumfam@{15}% Use this family as the temporary family.
  657. \def\MToldnos@#1{% \MToldnos@ MUST be used in math mode.
  658.   \ifmmode
  659.     \bgroup
  660.     \textfont15=\tenoldnum \scriptfont15=\sevenoldnum
  661.     \scriptscriptfont15=\fiveoldnum
  662.     \text{\tempoldnumfam@ #1}%
  663.     \egroup
  664.   \else
  665.     \relax
  666.     \errmessage{MathTime error: Use \string\oldstyle\ in math mode only.}%
  667.   \fi
  668. }%
  669. %
  670. \newlinechar=`\^^J
  671. \def\OldNumeralsTempFamily#1#2#3#4#5#6#7{%
  672.   \ifAMSTEXloaded
  673.     \font\tenoldnum=#1 at #2
  674.     \font\sevenoldnum=#1 at #5
  675.     \font\fiveoldnum=#1 at #7
  676.     \def\textdef@@#1{\textdef@#1\rm\textdef@#1\bf\textdef@#1\sl\textdef@#1\it%
  677.                      \textdef@#1\tempoldnum}
  678.     \DEFtempoldnos\let\DEFtempoldnos\undefined
  679.   \else
  680.     \message{Warning: cannot use \string\OldNumeralsTempFamily\space%
  681.              outside AMSTEX.^^J
  682.              I am using \string\OldNumeralsNewFamily\space instead.}%
  683.     \OldNumerals{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
  684.   \fi
  685. }%
  686. %%%% THIRD CHOICE
  687. \edef\innernewfam{\expandafter\noexpand\csname newfam\endcsname}
  688. \def\OldNumerals#1#2#3#4#5#6#7{%
  689.   \ifx\oldnumfam\undefined
  690.     \innernewfam\oldnumfam % Define a \newfam only if \oldnumfam is
  691.   \fi                      % not yet defined. 
  692.   \font\tenoldnum=#1 at #2
  693.   \font\sevenoldnum=#1 at #5
  694.   \font\fiveoldnum=#1 at #7
  695.   \textfont\oldnumfam=\tenoldnum \scriptfont\oldnumfam=\sevenoldnum
  696.   \scriptscriptfont\oldnumfam=\fiveoldnum
  697.   \ifAMSTEXloaded
  698.     \DEFoldnos\let\DEFoldnos\undefined
  699.   \else
  700.     \def\oldstyle{\fam\oldnumfam \tenoldnum}
  701.   \fi
  702. }
  703. \let\OldNumeralsNewFamily\OldNumerals
  704. %
  705. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  706. %% 4. The logos (taken from texnames.sty v1.08 by Nelson Beebe)
  707. %%
  708. %% Normally, the logo for AMSTEX uses family 2 fonts in its definition,
  709. %% which of course will give garbage in the context of the MathTime
  710. %% fonts. In texnames.sty the AMSTEX logo uses \cal: in this case if
  711. %% \NewCalligraphic has been called with fonts other than the cmsy
  712. %% fonts, the logo will look odd. In other words, the only way to get
  713. %% the \AmSTeX logo to look the way it is supposed to look is to use
  714. %% \NewCalligraphic with the cmsy fonts. 
  715. %%
  716. %% So I have decided that mathtime.tex will make `fake' logos which do
  717. %% not use family 2 or \cal. If you want the real logos, you must call
  718. %% the \MakeLogos macro. If \NewCalligraphic has been called the
  719. %% \MakeLogos macro will use as definition for the logos the
  720. %% definitions from texnames.sty. If \NewCalligraphic has _not_ been
  721. %% called, then the logo macros remain faked. In the former case, if
  722. %% fonts other than the cmsy fonts are used in \NewCalligraphic, the
  723. %% logos may look wrong.
  724. %%
  725. % Define "fake" logos:
  726. %
  727. \ifAMSTEXloaded\def\AmSTeX{AMS\TeX}\fi% Fake it
  728. %
  729. \ifx\laxread@\undefined
  730. \else
  731.   \ifx\LamSTeX\undefined% Normally defined in paper.st
  732.   \else
  733.     \def\LamSTeX{LAMS\TeX}% Fake it. 
  734.   \fi
  735. \fi
  736. %
  737. \def\MakeLogos{% Definitions taken from texnames.sty, ver. 1.08
  738.   \ifx\Calfam\undefined
  739.   \else
  740.     \ifAMSTEXloaded
  741.       \def\AmSTeX{$\Cal A$\kern-.1667em\lower.5ex\hbox{$\Cal M$}%
  742.               \kern-.125em$\Cal S$-\TeX}% Will look funny if cmsy fonts
  743.                                         % not used in \NewCalligraphic.
  744.     \fi
  745.     \ifx\laxread@\undefined
  746.     \else
  747.       \ifx\LamSTeX\undefined
  748.       \else
  749.         \def\LamSTeX{L\raise.42ex\hbox{\kern-.3em\the\scriptfont\Calfam A}%
  750.                      \kern-.2em\lower.376ex\hbox{\the\textfont\Calfam M}%
  751.                      \kern-.125em {\the\textfont\Calfam S}-\TeX}%
  752.       \fi
  753.     \fi
  754.   \fi
  755. }%
  756. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  757. %% 5. Accents and other Postscript incompatibilities.
  758. \ifAMSTEXloaded
  759.   \def\D#1{{\accent"C7 #1}}  % Change the dot accent for postscript
  760.                              % fonts.
  761.   \makeacc@\dot{0C7}         % AMSTEX math accent definition.
  762. \else
  763.   \def\dot{\mathaccent"70C7 }% PLAIN math accent definition.
  764.   \def\.#1{{\accent"C7 #1}}
  765. \fi
  766. \def\H#1{{\accent"CD #1}}    % Fix Hungarian umlaut for PostScript
  767.                              % fonts.
  768. %% In the context of Computer Modern fonts, to get a pounds sterling
  769. %% symbol (it looks like a script L with a horizontal line through it)
  770. %% one types {\it\$}. But this does not work with PostScript fonts as
  771. %% the pounds sterling symbol appears in all fonts in position "A3. So
  772. %% I define a macro \psterling to be character ^^a3. Of course, this
  773. %% is not strictly compatabible with PLAIN, but there really is no easy way
  774. %% around it. Note also that this requires TeX 3.0.
  775. %
  776. \def\psterling{^^a3}         % Define the pounds sterling macro. Should
  777.                              % work in all Postscript fonts. 
  778. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  779. %% 6. Finish up
  780. % Recover catcodes of @ and "
  781. \recoverquotecodezqrz\let\recoverquotecodezqrz=\undefined
  782. \recoveratcodezqrz\let\recoveratcodezqrz=\undefined
  783. %
  784. \endinput
  785. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  786. CHANGE LOG
  787.  
  788. Version 1.08a: (19 June 1993)
  789.  
  790. ---Put in extra comments.
  791. ---Fixed TeXplorator's address.
  792.  
  793. Version 1.09:  (26 June 1993)
  794.  
  795. ---Made font defintions more compatible with ambient package.
  796. ---Fixed eightpoint fonts in AMSPPT.STY.
  797. ---Rewrote AMSFonts routines. Note change in \AMSFonts format.
  798.  
  799. Version 1.09a: (29 June 1993)
  800.  
  801. ---Defined \newif's only once, even if mathtime.tex is loaded multiple
  802.    times.
  803.  
  804. Version 1.10:  (1 July 1993)
  805.  
  806. ---Defined the \MakeLogos macro and fake logos.
  807.  
  808. Version 1.11:  (4 July 1993)
  809.  
  810. ---Made slight change in \DefineAMSFontFamily.
  811.  
  812. Version 1.20:  (5 September 1993)
  813.  
  814. ---Simplified \newif stuff. (Why doesn't anyone tell me these things?)
  815. ---Added \OldNumerals.
  816. ---Changed (slightly) the way the fake logos look.
  817.  
  818. Version 1.21:  (8 September 1993)
  819.  
  820. ---Added \RomanFont, \ItalicFont et al. 
  821. ---Fixed TeXplorator's address (AGAIN). 
  822.  
  823. Version 1.22:  (21 September 1993)
  824.  
  825. ---Made \DefineAMSFontFamily work with Blue Sky's PS AMS fonts.
  826.  
  827. Version 1.23:  (25 September 1993)
  828.  
  829. ---Defined \psterling for pounds sterling. 
  830.  
  831. Version 1.30:  (7 April 1994)
  832.  
  833. ---Change \xdef's to \edef's in catcode saving macros.
  834. ---Define new macros for OldNumerals to avoid using a \newfam.
  835.  
  836. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  837. %% Sample Implementation
  838. %%
  839. %% This style is intended as a drop-in replacement of the font
  840. %% definitions made by PLAIN.TEX. It is compatible with PLAIN, AMSTEX,
  841. %% AMSTEX+AMSPPT.STY and LAMSTEX. Thus, if you stick this file at the
  842. %% top of a PLAIN or AMSTEX or LAMSTEX file, and make the
  843. %% appropriate macro calls as illustrated below, you will get the
  844. %% MathTime fonts for math mode and whatever text fonts you
  845. %% specify. This package can be put in a group to restrict its
  846. %% effects.
  847. %%
  848. %% NOTA BENE: 1. If you use AMSPPT.STY, make sure to \input this file AFTER
  849. %% the \documentstyle{amsspt} statement, but BEFORE the \topmatter
  850. %% statement. 2. Use \psterling to get the pounds sterling symbol in
  851. %% ALL fonts. 
  852. %% 
  853. %% Here is an example where we define a PostScript Times-Roman style:
  854. %
  855. %           \input mathtime
  856. %           \loadonlyonce{mttim10.tex} %[optional]
  857. %
  858. %% The next line is the font-style file's name.
  859. %
  860. %           \FONTStyle{PS Times Roman/MathTime [10 point]} %[optional]
  861. %
  862. %% Next decide on the point sizes for the math italic (MTMI), math
  863. %% symbols (MTSY), and the math extensions (MTEX). 
  864. %
  865. %           \mathitalic{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  866. %           \mathsymbols{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  867. %           \mathextension{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  868. %
  869. %% Now decide on the text faces. In the example below, I have decided
  870. %% to use ptmr at 10-9-8-7-6-5 point for
  871. %% text-ninepoint-eightpoint-script-sixpoint-scriptscript 
  872. %% respectively. You also need a boldface, italic, slant and
  873. %% typewriter face. 
  874. %% NOTE: If you are not using amsppt.sty, the eight-point and six-point
  875. %% sizes will be ignored, BUT PUT THEM IN ANYWAY! 
  876. %
  877. %           \Roman{ptmr}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  878. %           \Boldface{ptmrb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  879. %           \Italic{ptmri}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  880. %           \Slant{ptmro}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  881. %           \Typewriter{pcrb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  882. %           \CapsAndSmallCaps{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt} %[optional]
  883. %
  884. %% In case you need to use this file with AMSTEX or LAMSTEX, make sure
  885. %% to define the AMS fonts.
  886. %
  887. %           \AMSFonts{10pt}{9pt}{8pt}{7pt}{6pt}{5pt} %[optional]
  888. %% If you want to use Calligraphic characters (usually those in cmsy),
  889. %% call the \NewCalligraphic command. Note the different format from
  890. %% \Roman, \Boldface, etc. Also note that if you do not define
  891. %% Calligraphic characters, the \cal and \Cal commands will misbehave
  892. %% badly. 
  893. %%
  894. %           \NewCalligraphic{cmsy10}{cmsy9}{cmsy8}{cmsy7}{cmsy6}{cmsy5}
  895. %                                                      %[optional]
  896. %
  897. %% Since I am using the cmsy fonts I should call the \MakeLogos macro.
  898. %% Of course, I could use \MakeLogos even if I didn't use the cmsy
  899. %% fonts, but the logos might look funny.
  900. %
  901. %           \MakeLogos %[optional]
  902. %
  903. %% If you have old style digits (a.k.a. non-lining digits) available,
  904. %% you can define them using \OldNumerals. If we are AMSTEX we should
  905. %% use \OldNumeralsTempFamily (if we are not in AMSTEX, \OldNumerals
  906. %% will be chosen automagically).
  907. %
  908. %           \OldNumeralsTempFamily{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt} 
  909. %                                          %[optional]
  910. %
  911. %% The following are commands defined in mtmacs.tex to change which
  912. %% fonts numbers and math text use. For more information, see the
  913. %% mtmacs.tex documentation. They are all optional and do not work in
  914. %% eight-point mode in AMSPPT.STY (maybe I will change that someday).
  915. %% 
  916. %% The \MathRoman command chooses the font and point sizes for numbers
  917. %% and punctuation in math mode.
  918. %
  919. %           \MathRoman{ptmr}{10pt}{7pt}{5pt} %[optional]
  920. %
  921. %% The \MathBold command chooses which fonts to use as boldface in
  922. %% math mode. The analogous result happens with \MathBoldItalic.
  923. %
  924. %           \MathBold{ptmb}{10pt}{7pt}{5pt} %[optional]
  925. %           \MathBoldItalic{ptmbi}{10pt}{7pt}{5pt} %[optional]
  926. %
  927. %% At this point, insert other parameters that should be changed (for
  928. %% example, \baselineskip), plus other fonts. Here are a few examples:
  929. %% 
  930. %%
  931. %           \font\bigtext=\RomanFont at 12pt %[up to the user]
  932. %           \font\ssf=phvr at 10pt  %[up to the user]
  933. %%
  934. %% Finally, it is important to switch to this style with the \rm
  935. %% command.
  936. %
  937. %           \rm
  938. %           \endinput
  939. %%% End-of-TeX-file
  940. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  941. %%% Start-of-TeX-file mttim10.tex
  942. % mttim10.tex - version 1.05  (Last changed 1 July 1993)
  943. %
  944. % I use mathtime.tex (version >1.09a) to make a ten-point PS Times-Roman
  945. % style. I look especially good at \magstephalf. If you use me
  946. % with amsppt.sty, put me between the \documentstyle statement and the
  947. % \topmatter statement. Use \psterling for pounds sterling. 
  948. %
  949. \input mathtime
  950.  
  951. \loadonlyonce{mttim10.tex}
  952. \FONTStyle{PS Times-Roman/MathTime}
  953.  
  954. \mathitalic{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  955. \mathsymbols{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  956. \mathextension{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  957.  
  958. \Roman{ptmr}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  959. \Boldface{ptmb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  960. \Italic{ptmri}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  961. \Slant{ptmro}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  962. \Typewriter{pcrb}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  963. \CapsAndSmallCaps{ptmrc}{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  964.  
  965. \AMSFonts{10pt}{9pt}{8pt}{7pt}{6pt}{5pt}
  966.  
  967. \NewCalligraphic{cmsy10}{cmsy9}{cmsy8}{cmsy7}{cmsy6}{cmsy5}%Uses a
  968.                                %\newfam!!!
  969.  
  970. \MakeLogos
  971.  
  972. \rm
  973.  
  974. \endinput
  975. \endinput
  976. %%% End-of-TeX-file
  977.  
  978.